package ctype

import "encoding/json"

type ImageType int

const (
	Local ImageType = iota + 1
	QiNiuYun
)

func (i ImageType) MarshalJSON() ([]byte, error) {
	return json.Marshal(i.String())
}

func (i ImageType) String() string {
	switch i {
	case Local:
		return "本地"
	case QiNiuYun:
		return "七牛云"
	default:
		return "其它"
	}
}
